<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <meta http-Equiv="Expires" Content="0" />
    <title>JMP JVM远程应用监控工具</title>
    <link rel="stylesheet" href="/lib/layui/css/layui.css"/>
</head>
<style>
    .layui-layout-admin .layui-body {
        bottom: 0px;
    }
</style>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">JMP监控</div>
         <!-- 头部区域（可配合layui已有的水平导航） -->
	    <ul class="layui-nav layui-layout-left">
	      <li class="layui-nav-item"><a href="/index">控制台</a></li>
	    </ul>
	    <ul class="layui-nav layui-layout-right">
	      <li class="layui-nav-item">
	        <a href="javascript:;">
	          <img src="/lib/layui/images/touxiang.jpg" class="layui-nav-img">
	 			<span th:text="${username}"></span>
	        </a>
	      </li>
      <li class="layui-nav-item"><a href="/logiout">退出登录</a></li>
    </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:void(0)"><i class="layui-icon" style="font-size: 20px;">&#xe614;</i>&nbsp;应用列表</a>
                    <dl class="layui-nav-child" th:each="item:${list}">
                        <a class="" href="javascript:void(0)"><i class="layui-icon">&#xe665;</i>&nbsp;<span th:text="${item.get('address').name}"></span></a>
                        <dl class="layui-nav-child" th:each="j:${item.get('jps')}">
                            <dd>
                                <a th:onclick="'step(\''+${item.get('address').address}+'\','+${j.key}+')'" href="javascript:void(0)" th:text="${j.value.smallName}" th:title="${j.value.smallName}"></a>
                            </dd>
                        </dl>
                    </dl>
                </li>
                <li class="layui-nav-item">
			          <a href="javascript:;"><i class="layui-icon" style="font-size: 20px;">&#xe629;</i>&nbsp;系统管理</a>
			          <dl class="layui-nav-child">
			            <dd><a href="/userList" target="myiframe"><i class="layui-icon layui-icon-group" style="font-size: 12px; margin-right: 5px;"></i>用户列表</a></dd>
			          </dl>
       		    </li>         
            </ul>
        </div>
    </div>
  <!-- 内容主体区域 -->
    <div class="layui-body" style="top: 0px;overflow-y: hidden">      
        <iframe id="iframe" height="100%" width="100%" src="/main" frameborder="no" allowtransparency="yes" name="myiframe"></iframe>
    </div>
</div>
<script src="/lib/layui/layui.all.js"></script>
<script src="/lib/jquery.min.js"></script>
<script type="text/javascript">
    function index() {
        $("#iframe").attr("src","/main");
    }
    function step(address,id){
        $("#iframe").attr("src","/monitor?pid="+id+"&address="+address);
        //加载动画
        layer.load();
        setTimeout(function () {
            layer.closeAll('loading');
        }, 2000);
    }
</script>
</body>
</html>